/*
 * Copyright (c) 2022. China Mobile(SuZhou)Software Technology Co.,Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package vfs

import(
	"time"
)

var UsrConf UserConfig
var V *VFS
var Ctx *GrpcContext

type UserConfig struct {
	DataDir  string `json:"data_dir"`
	MountDir string `json:"mount_dir"`
	MetaUrl  string `json:"meta_url"`
}

type GrpcContext struct {
	Context
	gid uint32
	uid uint32
}

func (c *GrpcContext) Uid() uint32 {
	return c.uid
}
func (c *GrpcContext) SetUid(uid uint32)  {
	c.uid = uid
}

func (c *GrpcContext) Gid() uint32 {
	return c.gid
}

func (c *GrpcContext) SetGid(gid uint32) {
	c.gid = gid
}

func (c *GrpcContext) Value(key interface{}) interface{} {
	return nil
}

func (c *GrpcContext) Duration() time.Duration {
	return time.Since(time.Now())
}
func (c *GrpcContext) Canceled() bool { return false }


